package com.amigo.online.common.util.onesignal;

import com.alibaba.fastjson.JSONObject;

/**
 * 推送消息
 * @author pangdonghao
 * @version 1.0
 * @csdn https://blog.csdn.net/pangdongh
 * @createDate 2019/10/14 14:10
 */
public enum  PushMessageEnum {
    FOLLOW(1, "Aviso de preocupação", "Notice of concern", "关注通知", "Aviso de preocupação", "{} Seguindo você", "{} Seguindo você", "{} 关注了你", "{} Seguindo você");



    private Integer id;

    private String titlePt;

    private String titleEn;

    private String titleCn;

    private String titleEs;

    private String messagePt;

    private String messageEn;

    private String messageCn;

    private String messageEs;

    PushMessageEnum(Integer id, String titlePt, String titleEn, String titleCn, String titleEs, String messagePt, String messageEn, String messageCn, String messageEs) {
        this.id = id;
        this.titlePt = titlePt;
        this.titleEn = titleEn;
        this.titleCn = titleCn;
        this.titleEs = titleEs;
        this.messagePt = messagePt;
        this.messageEn = messageEn;
        this.messageCn = messageCn;
        this.messageEs = messageEs;
    }

    public JSONObject getHeading(){
        JSONObject heading = new JSONObject();
        heading.put("en", this.titleEn);
        heading.put("zh-Hans", this.titleCn);
        heading.put("pt",this.titlePt);
        return heading;
    }
    public JSONObject getContents(){
        JSONObject heading = new JSONObject();
        heading.put("en", this.messageEn);
        heading.put("zh-Hans", this.messageCn);
        heading.put("pt",this.messagePt);
        return heading;
    }
    public JSONObject getContents(String var){
        JSONObject heading = new JSONObject();
        heading.put("en", this.messageEn.replace("{}",var));
        heading.put("zh-Hans", this.messageCn.replace("{}",var));
        heading.put("pt",this.messagePt.replace("{}",var));
        return heading;
    }
    public static void main(String[] args) {
        System.out.println(PushMessageEnum.FOLLOW.getContents("asd"));
    }
}
